#!/bin/sh

set -e

INSTALL_HOME="$(cd "$(dirname "$0")" && pwd)"
cd "${INSTALL_HOME}"

PID=`ps -ef | grep "${INSTALL_HOME}/rocketmq_exporter" | grep -v grep | awk -F ' ' '{print$2}'`

if [ ! -z "${PID}" ];then
  echo "kill -9 ${PID}"
  kill -9 ${PID}
fi

nohup ${INSTALL_HOME}/rocketmq_exporter > ${INSTALL_HOME}/exporter.log 2>&1 &

